<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>修改属性</title>
</head>
<body>
	<p id="main" data="123">hhh</p>

	<script>
		var main = document.getElementById('main') 
		// alert(main.getAttribute("data"));
		// 获取属性
		main.setAttribute("data","llll");
		main.setAttribute("dd","sdsdsd")
		// 修改添加属性
		// .src
		// .href
		//重命名两个标签
		main.style.color = "red"

	</script>
</body>
</html>